package com.hxy.entity;


import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;
import java.util.Collections;
import java.util.List;

@Data
public class AuthEmp implements UserDetails {

    private Integer empid;
    private String emploginname;
    private String emplogincode;
    private boolean isaccountnonexpired;
    private boolean isaccountnonlocked;
    private boolean iscredentialsnonexpired;
    private boolean isenabled;
    private String rolename;
    private String resource;   //具体增删改查操作
    private String authority;

    private Collection authorites ;




    public Collection<? extends GrantedAuthority> setAuthorities(Collection collection) {
        return this.authorites = collection;
    }
    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return this.authorites;
    }

    @Override
    public String getPassword() {
        return this.emplogincode;
    }

    @Override
    public String getUsername() {
        return this.emploginname;
    }

    @Override
    public boolean isAccountNonExpired() {
        return this.isaccountnonexpired;
    }

    @Override
    public boolean isAccountNonLocked() {
        return this.isaccountnonlocked;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return this.iscredentialsnonexpired;
    }

    @Override
    public boolean isEnabled() {
        return this.isenabled;
    }



}

